package mirrormonkey.core;

import mirrormonkey.framework.ConnectionInfo;
import mirrormonkey.framework.entity.StaticEntityData;
import mirrormonkey.framework.entity.SyncEntity;
import mirrormonkey.util.listeners.ManagedListener;
import mirrormonkey.util.listeners.MapListener;

@MapListener
public interface EntityLifecycleListener extends ManagedListener {

	public static final int FRAMEWORK_MAX_SORTING_ORDER = 0;

	public static final int USER_MIN_SORTING_ORDER = FRAMEWORK_MAX_SORTING_ORDER + 1;

	public void entityInitialized(SyncEntity entity,
			ConnectionInfo connectionInfo);

	public void entityReplaced(SyncEntity replacedEntity,
			StaticEntityData replacedStaticData, SyncEntity replacingEntity,
			ConnectionInfo connectionInfo);

	public void entityReplacing(SyncEntity replacedEntity,
			StaticEntityData replacedStaticData, SyncEntity replacingEntity,
			ConnectionInfo connectionInfo);

	public void entityRemoved(SyncEntity entity, ConnectionInfo connectionInfo);

	public int getSortingOrder();

}
